import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { PriceManageComponent } from './pages/price-manage/price-manage.component';
import { ContractManageComponent } from './pages/contract-manage/contract-manage.component';
import { PriceGradeComponent } from './pages/price-grade/price-grade.component';
import { AddContractComponent } from './pages/add-contract/add-contract.component';
import { ContractDetailComponent } from './pages/contract-detail/contract-detail.component';
import { OrderComponent } from './pages/order/order.component';
import { OrderDetailComponent } from './pages/order-detail/order-detail.component';
import { OrderMeetComponent } from './pages/order-meet/order-meet.component';
import { MeetDetailComponent } from './pages/meet-detail/meet-detail.component';
import { OrderTreasureComponent } from './pages/order-treasure/order-treasure.component'
import { ReturnComponent } from './pages/return/return.component';
import { ReturnDetailComponent } from './pages/return-detail/return-detail.component';
import { CounterGoodsComponent } from './pages/counter-goods/counter-goods.component';
import { GoodsDetailComponent } from './pages/goods-detail/goods-detail.component';
import { CounterReturnComponent } from './pages/counter-return/counter-return.component';
import { CounterDetailComponent } from './pages/counter-detail/counter-detail.component';
import { CounterSalesComponent } from './pages/counter-sales/counter-sales.component';
import { CounsalesDetailComponent } from './pages/counsales-detail/counsales-detail.component';
import { CounterSettingComponent } from './pages/counter-setting/counter-setting.component';
import { CounsettingDetailComponent } from './pages/counsetting-detail/counsetting-detail.component';
import { PromotionApplicationComponent } from './pages/promotion-application/promotion-application.component';
import { CounterInventoryComponent } from './pages/counter-inventory/counter-inventory.component';
import { CouninventoryDetailComponent } from './pages/couninventory-detail/couninventory-detail.component';
import { CounterInvoicingComponent } from './pages/counter-invoicing/counter-invoicing.component';
import { InvoicingDetailComponent } from './pages/invoicing-detail/invoicing-detail.component';
import { CarSettingComponent } from './pages/car-setting/car-setting.component';
import { CarsettingDetailComponent } from './pages/carsetting-detail/carsetting-detail.component';
import { CarGoodsComponent } from './pages/car-goods/car-goods.component';
import { CargoodsDetailComponent } from './pages/cargoods-detail/cargoods-detail.component';
import { CarDepotComponent } from './pages/car-depot/car-depot.component';
import { CarDepotDetailComponent } from './pages/cardepot-detail/cardepot-detailcomponent';
import { CarShipComponent } from './pages/car-ship/car-ship.component';
import { CarShipDetailComponent } from './pages/carship-detail/carship-detail.component';
import { CarReturnComponent } from './pages/car-return/car-return.component';
import { CarReturnDetailComponent } from './pages/carreturn-detail/carreturn-detail.component';
import { CarPaymentComponent } from './pages/car-payment/car-payment.component';
import { CarPayDetailComponent } from'./pages/carpay-detail/carpay-detail.component';
import { CarBackDepotComponent } from './pages/carback-depot/carback-depot.component';
import { CarBackDetailComponent } from './pages/carback-detail/carback-detail.component';
import { CarDifferenceComponent } from './pages/car-difference/car-difference.component';
import { PromotionSettingComponent } from './pages/promotion-setting/promotion-setting.component';
import { PromotionSetDetailComponent } from './pages/promotionset-detail/promotionset-detail.component'; 
import { PromotionEffectComponent } from './pages/promotion-effect/promotion-effect.component';
import { SellingCodeComponent } from './pages/selling-code/selling-code.component';
import { SellingCodeDetailComponent } from './pages/sellingcode-detail/sellingcode-detail.component';
import { HomeCarouselComponent } from './pages/home-carousel/home-carousel.component';
import { HomeCarouselDetailComponent } from './pages/homecarousel-detail/homecarousel-detail.component';
const routes: Routes = [ 
    {
        path: 'price', component: PriceManageComponent, data: {
            breadcrumbs: [{ title: '销售管理', path: '/sales/price' }, { title: '价格管理' }]
        },
        children: [
            {
                path: 'add', component: AddContractComponent, data: {
                    breadcrumbs: [{ title: '添加合同', path: '/sales/add' }, { title: '添加合同' }]
                },
            },
        ]
    },
    {
        path: 'contract', component: ContractManageComponent, data: {
            breadcrumbs: [{ title: '销售合同', path: '/sales/contract' }, { title: '销售合同' }]
        },
        children: [
            {
                path: 'detail', component: ContractDetailComponent, data: {
                    breadcrumbs: [{ title: '添加合同', path: '/sales/detail' }, { title: '添加合同' }]
                },
            },
        ]
    },
    {
        path: 'grade', component: PriceGradeComponent, data: {
            breadcrumbs: [{ title: '等级价格', path: '/sales/grade' }, { title: '等级价格' }]
        },
    },

    {
        path: 'order', component: OrderComponent, data: {
            breadcrumbs: [{ title: '订单管理', path: '/sales/order' }, { title: '订单管理' }]
        },
        children: [
            {
                path: 'orderd', component: OrderDetailComponent, data: {
                    breadcrumbs: [{ title: '添加订单', path: '/sales/orderd' }, { title: '添加订单' }]
                },
            },
        ]
    }, 
    {
        path: 'meet', component: OrderMeetComponent, data: {
            breadcrumbs: [{ title: '订货会', path: '/sales/meet' }, { title: '订货会' }]
        },
        children: [
            {
                path: 'meetd', component: MeetDetailComponent, data: {
                    breadcrumbs: [{ title: '新增订单', path: '/sales/meetd' }, { title: '新增订单' }]
                },
            },
        ]
    },
    {
        path: 'treasure', component: OrderTreasureComponent, data: {
            breadcrumbs: [{ title: '订单宝', path: '/sales/treasure' }, { title: '订单宝' }]
        },
    },
    {
        path: 'return', component: ReturnComponent, data: {
            breadcrumbs: [{ title: '退货管理', path: '/sales/return' }, { title: '退货管理' }]
        },
        children: [
            {
                path: 'returnd', component: ReturnDetailComponent, data: {
                    breadcrumbs: [{ title: '新增退单', path: '/sales/returnd' }, { title: '新增退单' }]
                },
            },
        ]
    },
    {
        path: 'counter', component: CounterGoodsComponent, data: {
            breadcrumbs: [{ title: '专柜要货', path: '/sales/counter' }, { title: '专柜要货' }]
        },
        children: [
            {
                path: 'counterd', component: GoodsDetailComponent, data: {
                    breadcrumbs: [{ title: '新增要货', path: '/sales/counterd' }, { title: '新增要货' }]
                },
            },
        ]
    },
    {
        path: 'counreturn', component: CounterReturnComponent, data: {
            breadcrumbs: [{ title: '专柜退货', path: '/sales/counreturn' }, { title: '专柜退货' }]
        },
        children: [
            {
                path: 'counreturnd', component: CounterDetailComponent, data: {
                    breadcrumbs: [{ title: '新增专退', path: '/sales/counreturnd' }, { title: '新增专退' }]
                },
            },
        ]
    },
    {
        path: 'counsales', component: CounterSalesComponent, data: {
            breadcrumbs: [{ title: '专柜销单量', path: '/sales/counsales' }, { title: '专柜销单量' }]
        },
        children: [
            {
                path: 'counsalesd', component: CounsalesDetailComponent, data: {
                    breadcrumbs: [{ title: '新增专销', path: '/sales/counsalesd' }, { title: '新增专销' }]
                },
            },
        ]
    },
    {
        path: 'counsetting', component: CounterSettingComponent, data: {
            breadcrumbs: [{ title: '专柜设置', path: '/sales/counsetting' }, { title: '专柜设置' }]
        },
        children: [
            {
                path: 'counsettingd', component: CounsettingDetailComponent, data: {
                    breadcrumbs: [{ title: '新增设置', path: '/sales/counsettingd' }, { title: '新增设置' }]
                },
            },
        ]
    },
    {
        path: 'application', component: PromotionApplicationComponent, data: {
            breadcrumbs: [{ title: '促销申请', path: '/sales/application' }, { title: '促销申请' }]
        },
        // children: [
        //     {
        //         path: 'counsettingd', component: CounsettingDetailComponent, data: {
        //             breadcrumbs: [{ title: '新增设置', path: '/sales/counsettingd' }, { title: '新增设置' }]
        //         },
        //     },
        // ]
    },
    {
        path: 'inventory', component: CounterInventoryComponent, data: {
            breadcrumbs: [{ title: '专柜盘点单', path: '/sales/inventory' }, { title: '专柜盘点单' }]
        },
        children: [
            {
                path: 'inventoryd', component: CouninventoryDetailComponent, data: {
                    breadcrumbs: [{ title: '新增盘点', path: '/sales/inventoryd' }, { title: '新增盘点' }]
                },
            },
        ]
    },
    {
        path: 'invoicing', component: CounterInvoicingComponent, data: {
            breadcrumbs: [{ title: '专柜进销存', path: '/sales/invoicing' }, { title: '专柜进销存' }]
        },
        children: [
            {
                path: 'invoicingd', component: InvoicingDetailComponent, data: {
                    breadcrumbs: [{ title: '进销存明细', path: '/sales/invoicingd' }, { title: '进销存明细' }]
                },
            },
        ]
    },
    {
        path: 'carsetting', component: CarSettingComponent, data: {
            breadcrumbs: [{ title: '车销设置', path: '/sales/carsetting' }, { title: '车销设置' }]
        },
        children: [
            {
                path: 'carsettingd', component: CarsettingDetailComponent, data: {
                    breadcrumbs: [{ title: '新增车销库', path: '/sales/carsettingd' }, { title: '新增车销库' }]
                },
            },
        ]
    },
    {
        path: 'cargoods', component: CarGoodsComponent, data: {
            breadcrumbs: [{ title: '车销要货', path: '/sales/cargoods' }, { title: '车销要货' }]
        },
        children: [
            {
                path: 'cargoodsd', component: CargoodsDetailComponent, data: {
                    breadcrumbs: [{ title: '新增车销要货', path: '/sales/cargoodsd' }, { title: '新增车销要货' }]
                },
            },
        ]
    },
    {
        path: 'cardepot', component: CarDepotComponent, data: {
            breadcrumbs: [{ title: '车销入库', path: '/sales/cardepot' }, { title: '车销入库' }]
        },
        children: [
            {
                path: 'cardepotd', component: CarDepotDetailComponent, data: {
                    breadcrumbs: [{ title: '新增车销入库', path: '/sales/cardepotd' }, { title: '新增车销入库' }]
                },
            },
        ]
    },
    {
        path: 'carship', component: CarShipComponent, data: {
            breadcrumbs: [{ title: '车销发货', path: '/sales/carship' }, { title: '车销发货' }]
        },
        children: [
            {
                path: 'carshipd', component: CarShipDetailComponent, data: {
                    breadcrumbs: [{ title: '新增销售订单', path: '/sales/carshipd' }, { title: '新增销售订单' }]
                },
            },
        ]
    },
    {
        path: 'carreturn', component: CarReturnComponent, data: {
            breadcrumbs: [{ title: '车销退货', path: '/sales/carreturn' }, { title: '车销退货' }]
        },
        children: [
            {
                path: 'carreturnd', component: CarReturnDetailComponent, data: {
                    breadcrumbs: [{ title: '新增销售退单', path: '/sales/carreturnd' }, { title: '新增销售退单' }]
                },
            },
        ]
    },
    {
        path: 'carpayment', component: CarPaymentComponent, data: {
            breadcrumbs: [{ title: '车销交款', path: '/sales/carpayment' }, { title: '车销交款' }]
        },
        children: [
            {
                path: 'carpayd', component: CarPayDetailComponent, data: {
                    breadcrumbs: [{ title: '新增车销交款单', path: '/sales/carpayd' }, { title: '新增车销交款单' }]
                },
            },
        ]
    },
    {
        path: 'carbackdepot', component: CarBackDepotComponent, data: {
            breadcrumbs: [{ title: '车销退库', path: '/sales/carbackdepot' }, { title: '车销退库' }]
        },
        children: [
            {
                path: 'carbackd', component: CarBackDetailComponent, data: {
                    breadcrumbs: [{ title: '新增车销退库单', path: '/sales/carbackd' }, { title: '新增车销退库单' }]
                },
            },
        ]
    },
    {
        path: 'cardifference', component: CarDifferenceComponent, data: {
            breadcrumbs: [{ title: '车销差异单', path: '/sales/cardifference' }, { title: '车销差异单' }]
        },
        // children: [
        //     {
        //         path: 'carbackd', component: CarBackDetailComponent, data: {
        //             breadcrumbs: [{ title: '新增车销退库单', path: '/sales/carbackd' }, { title: '新增车销退库单' }]
        //         },
        //     },
        // ]
    },
    {
        path: 'promotionset', component: PromotionSettingComponent, data: {
            breadcrumbs: [{ title: '促销设置', path: '/sales/promotionset' }, { title: '促销设置' }]
        },
        children: [
            {
                path: 'promotionsetd', component: PromotionSetDetailComponent, data: {
                    breadcrumbs: [{ title: '新增促销单', path: '/sales/promotionsetd' }, { title: '新增促销单' }]
                },
            },
        ]
    },
    {
        path: 'promotioneffect', component: PromotionEffectComponent, data: {
            breadcrumbs: [{ title: '促后效果', path: '/sales/promotioneffect' }, { title: '促后效果' }]
        },
        // children: [
        //     {
        //         path: 'promotionsetd', component: PromotionSetDetailComponent, data: {
        //             breadcrumbs: [{ title: '新增促销单', path: '/sales/promotionsetd' }, { title: '新增促销单' }]
        //         },
        //     },
        // ]
    },
    {
        path: 'sellingcode', component: SellingCodeComponent, data: {
            breadcrumbs: [{ title: '卖货码', path: '/sales/sellingcode' }, { title: '卖货码' }]
        },
        children: [
            {
                path: 'sellingcoded', component: SellingCodeDetailComponent, data: {
                    breadcrumbs: [{ title: '新增卖货码', path: '/sales/sellingcoded' }, { title: '新增卖货码' }]
                },
            },
        ]
    },
    {
        path: 'homecarousel', component: HomeCarouselComponent, data: {
            breadcrumbs: [{ title: '首页轮播', path: '/sales/homecarousel' }, { title: '首页轮播' }]
        },
        children: [
            {
                path: 'homecarouseld', component: HomeCarouselDetailComponent, data: {
                    breadcrumbs: [{ title: '新增广告', path: '/sales/homecarouseld' }, { title: '新增广告' }]
                },
            },
        ]
    },
];

export const declarationComponents = [
    PriceManageComponent,
    ContractManageComponent,
    PriceGradeComponent,
    AddContractComponent,
    ContractDetailComponent,
    OrderComponent,
    OrderDetailComponent,
    OrderMeetComponent,
    MeetDetailComponent,
    OrderTreasureComponent,
    ReturnComponent,
    ReturnDetailComponent,
    CounterGoodsComponent,
    GoodsDetailComponent,
    CounterReturnComponent,
    CounterDetailComponent,
    CounterSalesComponent,
    CounsalesDetailComponent,
    CounterSettingComponent,
    CounsettingDetailComponent,
    PromotionApplicationComponent,
    CounterInventoryComponent,
    CouninventoryDetailComponent,
    CounterInvoicingComponent,
    InvoicingDetailComponent,
    CarSettingComponent,
    CarsettingDetailComponent,
    CarGoodsComponent,
    CargoodsDetailComponent,
    CarDepotComponent,
    CarDepotDetailComponent,
    CarShipComponent,
    CarShipDetailComponent,
    CarReturnComponent,
    CarReturnDetailComponent,
    CarPaymentComponent,
    CarPayDetailComponent,
    CarBackDepotComponent,
    CarBackDetailComponent,
    CarDifferenceComponent,
    PromotionSettingComponent,
    PromotionSetDetailComponent,
    PromotionEffectComponent,
    SellingCodeComponent,
    SellingCodeDetailComponent,
    HomeCarouselComponent,
    HomeCarouselDetailComponent,

];

export const entryComponents = [
    PriceManageComponent,
    ContractManageComponent,
    PriceGradeComponent,
    AddContractComponent,
    ContractDetailComponent,
    OrderComponent,
    OrderDetailComponent,
    OrderMeetComponent,
    MeetDetailComponent,
    OrderTreasureComponent,
    ReturnComponent,
    ReturnDetailComponent,
    CounterGoodsComponent,
    GoodsDetailComponent,
    CounterReturnComponent,
    CounterDetailComponent,
    CounterSalesComponent,
    CounsalesDetailComponent,
    CounterSettingComponent,
    CounsettingDetailComponent,
    PromotionApplicationComponent,
    CounterInventoryComponent,
    CouninventoryDetailComponent,
    CounterInvoicingComponent,
    InvoicingDetailComponent,
    CarSettingComponent,
    CarsettingDetailComponent,
    CarGoodsComponent,
    CargoodsDetailComponent,
    CarDepotComponent,
    CarDepotDetailComponent,
    CarShipComponent,
    CarShipDetailComponent,
    CarReturnComponent,
    CarReturnDetailComponent,
    CarPaymentComponent,
    CarPayDetailComponent,
    CarBackDepotComponent,
    CarBackDetailComponent,
    CarDifferenceComponent,
    PromotionSettingComponent,
    PromotionSetDetailComponent,
    PromotionEffectComponent,
    SellingCodeComponent,
    SellingCodeDetailComponent,
    HomeCarouselComponent,
    HomeCarouselDetailComponent,
];

@NgModule({
    imports: [
        RouterModule.forChild(routes)
    ],
    exports: [
        RouterModule
    ]
})
export class ManageRoutingModule { }